package com.mybatis.sqlsession;

import com.mybatis.config.XMLConfigurationBuilder;
import com.mybatis.entity.Configuration;

import java.io.InputStream;

/**
 * 创建人: yyn
 * 创建时间:2021/7/8 21:17
 */
public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build (InputStream inputStream) throws Exception {
        XMLConfigurationBuilder xmlConfiguration = new XMLConfigurationBuilder();
        Configuration configuration = xmlConfiguration.parse(inputStream);
        return new DefaultSqlSessionFactory(configuration);
    }
}
